home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A.C.E. 2
/
ACE CD 2.iso
/
FILES
/
GAMES
/
1-L
/
FUNS4U52.DMS
/
FUNS4U52.adf
/
Teddy Books.AMOS
/
Teddy Books.amosSourceCode
< prev
Wrap
AMOS Source Code
|
1991-10-20
|
13KB
|
381 lines
Break Off : Key Speed 255,255 : Screen Open 0,320,200,16,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 0
Dim SCB(7),USED(8),RO(6),GS(8,2),RD(8),SX(7),SY(7),TX(6),TY(6),X(7),Y(7)
Reserve As Chip Work 6,12500 : Bload "sound/mod.books",6
Reserve As Chip Work 7,4200 : Bload "sound/mod.books.nt",7
Sload Start(6),Start(7)
Hide On : INIT : GTDTA
LEVEL=1
STRT:
Unpack 16 To 0 : Screen Hide 0
For Z=1 To 8 : USED(Z)=0 : GS(Z,1)=0 : GS(Z,2)=0 : Next Z
Palette $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
Timer=0 : PASSED=1 : Bob 7,268,38,24 : Bob 8,256,74,26 : Channel 7 To Bob 7 : Channel 8 To Bob 8
For Z=1 To 6 : Bob Z,TX(Z),TY(Z),13 : Channel Z To Bob Z : Wait Vbl : Next Z
For Z=9 To 15 : Bob Z,SX(Z-8),SY(Z-8),18 : Channel Z To Bob Z : Next Z
Screen Show 0 : Double Buffer
If LEVEL<3 Then TRIES=3 : BOOKT=6 : Else TRIES=5 : BOOKT=8
If LEVEL=3 : LIMLVL=2 : End If
If LEVEL=4 : LIMLVL=4 : End If
If LEVEL>2
RO=1 : RANDOM[6]
For Z=1 To 6 : RO(Z)=RD(Z) : Next Z
End If
RANDOM[BOOKT]
For Z=1 To BOOKT : GS(Z,1)=RD(Z) : RD(Z)=Z : Next Z
If LEVEL>1 : RANDOM[BOOKT]
For Z=1 To BOOKT : GS(Z,1)=RD(Z) : Next Z
End If
CRECT=0
TRY=0
AGAIN:
For Z=PASSED To BOOKT : If GS(Z,2)=0 : PASSED=Z : BOOKREAD=GS(Z,1) : Exit : End If : Next Z
On LEVEL Proc BOOKL1,BOOKL2,BOOKL3,BOOKL4
P$="Which book is Daddy Ted reading?" : Gosub PRNTIT : IPX=PL+17 : Clear Key
Update : Wait Vbl
Fade 3,$0,$EEE,$8AA,$244,$4A4,$80,$64C,$42A,$E86,$E64,$EE0,$A64,$620,$E82,$0,$EEE
Wait 45
REDO:
P$="Which book is Daddy Ted reading?" : Gosub PRNTIT : IPX=PL+17 : Clear Key
Repeat
PZ=Free : Add TM,1
K$=Inkey$
SCOD=Scancode
If SCOD=69
Fade 1 : Wait 15
For LOP=1 To 15 : Erase LOP : Next LOP
If Chip Free+Fast Free>250000
Run "Menu_A500.AMOS"
Else
Run "No_Memory.AMOS"
End If
End If
If SCOD=89
SCOD=0 : CTR=0 : NWLVL : PASSED=1 : CRECT=0 : Goto STRT
End If
If K$<>"" : K=Val(K$)
If K>0 and K<BOOKT+1
Extension_1_022E 1,3,0,0
Extension_8_0006 PL+10,198,K$-" " : Add TRY,1 : Wait 30
If K=BOOKREAD : GS(PASSED,2)=True : Add CRECT,1 : DNE=True : WIN=True : End If
If K<>BOOKREAD : DNE=True : WIN=0 : End If
End If
End If
If Rnd(200)=5 : ANSTR : Wait Vbl : End If
Wait Vbl
Until DNE=True
DNE=0
If WIN=0
Amal 7,"Anim 2,(23,4)(24,4)(25,4)(24,4)(23,4)(24,4)(25,4)(24,4)" : Amal On 7
If LEVEL>2 : P$="Wrong." : Gosub PRNTIT : End If
If TRY<TRIES and LEVEL<3 : Extension_1_022E 1,2,0,0 : P$="Wrong, try again." : Gosub PRNTIT : Wait 20 : Sam Swapped : End If
WT[2]
If TRY<TRIES and LEVEL>2
If K>BOOKREAD
Extension_1_022E 1,2,0,0
FK$="" : P$="Try a smaller number." : Gosub PRNTIT
For FL=1 To 5
FK$=Inkey$ : If FK$<>"" : FL=5 : Goto NOF : End If
Bob 30,130,110,22 : Wait 10 : Bob 30,-300,-300,72 : Wait 10
NOF:
Next FL
End If
If K<BOOKREAD
Extension_1_022E 1,2,0,0
FK$="" : P$="Try a bigger number." : Gosub PRNTIT
For FL=1 To 5
FK$=Inkey$ : If FK$<>"" : FL=5 : Goto NOF1 : End If
Bob 30,90,90,21 : Wait 10 : Bob 30,-300,-300,21 : Wait 10
NOF1:
Next FL
End If
Bob Off 30 : Update : Wait Vbl
If LEVEL=3 or LEVEL=4
For Z=1 To BOOKT : If K=USED(Z) : NOPE=True : End If : Next Z
If NOPE=0
For Z=1 To BOOKT
If K=GS(Z,1)
Add CTR,1,1 To LIMLVL : USED((LIMLVL-1)+CTR)=K : DX=X Bob(CTR+19) : DY=Y Bob(CTR+19) : DI=I Bob(CTR+19)
If DI>3 and DI<8 : Bob 25+CTR,DX+15,DY+3,63+GS(Z,1) : WT[1] : End If
If DI>7 and DI<11 : Bob 25+CTR,DX+13,DY,63+GS(Z,1) : WT[1] : End If
End If
Next Z
End If
NOPE=0 : DX=0 : DY=0 : DI=0
End If
Goto REDO
End If
If TRY<TRIES and LEVEL<3 : Goto REDO : End If
If TRY=TRIES
P$="Wrong, he's reading book"+Str$(BOOKREAD)+"."
Add PASSED,1 : If PASSED=7 : PASSED=1 : End If : Gosub PRNTIT : WT[4] : TRY=0
Extension_1_022E 1,2,0,0 : Wait 100 : Sam Swapped
CTR=0 : Goto AGAIN
End If
End If
If WIN
Extension_1_022E 1,1,0,0
P$="That's right!" : Gosub PRNTIT : CRECT : WT[3]
If CRECT=6 : CTR=0 : PASSED=1 : CRECT=0 : Goto STRT : End If
If CRECT<6 : Goto AGAIN : End If
Sam Swapped
End If
End
Procedure WT[WTN]
For Z=1 To WTN*40
K$=Inkey$
If K$<>"" : Z=WTN*40 : End If
Wait 1
If Rnd(100)=5
ANSTR
Wait Vbl
End If
Next Z
End Proc
Procedure CRECT
Shared SX(),SY(),CTR,RO(),RO,LEVEL,GS(),PASSED,BOOKT,TRY,WIN,CRECT
If LEVEL=1
Amal GS(PASSED,1),"Anim 1,(14,8)(15,8)(16,8)(17,8)" : Amal On GS(PASSED,1)
Add PASSED,1 : TRY=0 : WIN=0
Wait 60 : Screen Swap : Screen Copy Logic(0) To Physic(0) : Wait Vbl
End If
If LEVEL=2
Amal GS(PASSED,1),"Anim 1,(14,8)(15,8)(16,8)(17,8)" : Amal On GS(PASSED,1)
Add PASSED,1 : TRY=0 : WIN=0
Wait 60 : Screen Swap : Screen Copy Logic(0) To Physic(0) : Wait Vbl
End If
If LEVEL>2
Amal RO(RO),"Anim 1,(14,8)(15,8)(16,8)(17,8)" : Amal On RO(RO)
Add PASSED,1 : TRY=0 : WIN=0 : Add RO,1 : Wait 60
Screen Copy Physic(0) To Logic(0) : Screen Swap : Wait Vbl
End If
If CRECT=6
Extension_1_022E 1,0,0,0
Autoback 1 : Bob Update Off
For Z=1 To 6
Bob Clear : Paste Bob X Bob(Z),Y Bob(Z),I Bob(Z) : Bob Off Z : Wait Vbl : Bob Draw
Next Z
Screen Copy Logic(0) To Physic(0) : Bob Update On : Autoback 2
If LEVEL>2
Autoback 0 : Bob Update Off
For Z=30 To 19 Step -1 : Bob Clear : Bob Off Z : Bob Draw : Next Z
Screen Copy Logic(0) To Physic(0)
Bob Update On : Autoback 2
End If
Bob 9,253,119,35 : Amal 8,"Anim 1,(27,6)(28,6)" : Amal On 8
Wait 25
Autoback 0 : Bob Update Off : Bob Clear
Bob 7,260,28,29 : Bob 8,264,92,32 : Bob Draw
Screen Copy Logic(0),X Bob(7)-20,Y Bob(7)-20,X Bob(7)+60,Y Bob(7)+20 To Physic(0),X Bob(7)-20,Y Bob(7)-20
Screen Copy Logic(0),261,123,320,138 To Physic(0),261,123
Screen Swap : Wait Vbl
MY=Y Bob(7)
For Z=1 To 11
Bob Clear
Bob 7,,MY,29 : Bob 8,,MY+64,32 : Add MY,2
Bob Draw
Screen Copy Logic(0),X Bob(7)-20,Y Bob(7)-20,X Bob(7)+60,Y Bob(7)+20 To Physic(0),X Bob(7)-20,Y Bob(7)-20
Screen Swap : Wait Vbl
Next Z
Bob Update On : Autoback 2
Wait 10 : Amal 7,"Anim 0,(29,12)(30,12)(31,12)" : Amal 8,"Anim 0,(33,18)(34,18)"
Amal On 7 : Amal On 8 : MY=50 : Autoback 0 : Bob Update Off
For Z=1 To 30
Bob Clear : Bob 7,,MY, : Bob 8,,MY+64, : Add MY,1
If Z=20 : Bob Off 9 : End If
Bob Draw
Screen Copy Logic(0),X Bob(7)-2,Y Bob(7)-2,X Bob(7)+60,Y Bob(7)+5 To Physic(0),X Bob(7)-2,Y Bob(7)-2
Screen Swap : Wait Vbl
Next Z
Bob Update On : Autoback 2 : Amal Off 7 : Amal Off 8 : Screen Swap : Wait 10
Bob 7,,,44 : Bob 8,250,133,50 : Wait 10
Amal 7,"Anim 0,(44,6)(45,6)(46,6)(47,6)(48,6)(49,6) ; Move -230,0,230"
Amal 8,"Anim0,(50,6)(51,6)(52,6)(53,6)(54,6)(55,6) ; Move -230,0,230"
Amal On : While Chanmv(7) :
Wend : Amal Off 7 : Amal Off 8 : Autoback 0 : Bob Update Off
Bob Clear : Bob 7,22,78,39 : Bob 8,36,138,43 : Bob Draw
Screen Copy Logic(0),8,88,85,189 To Physic(0),8,88
Screen Swap : Wait Vbl
Bob Update On : Autoback 2
Amal 7,"Anim 1,(40,6)(41,6)(56,6)" : Amal On 7 : Screen Swap : Wait 30
Fade 1,$0,$666,$446,$22,$40,$20,$204,$2,$422,$422,$440,$422,$200,$420,$0,$FFF
Wait 20 : Autoback 0 : Bob Update Off
Bob Clear : Bob 7,33,76,44 : Bob 8,23,130,50 : Bob Draw
Screen Copy Logic(0),8,68,85,189 To Physic(0),8,68 : Screen Swap : Wait Vbl
Bob Update On : Autoback 2 : Wait Vbl
Amal 7,"Anim0,(44,6)(45,6)(46,6)(47,6)(48,6)(49,6) ; Move -80,0,80"
Amal 8,"Anim0,(50,6)(51,6)(52,6)(53,6)(54,6)(55,6) ; Move -80,0,80"
Amal On : While Chanmv(7) : Wend : Amal Off 7 : Amal Off 8
For Z=9 To 15 : Bob Z,SX(Z-8),SY(Z-8),18 : Channel Z To Bob Z : Next Z
WT[5] : Fade 2 : Wait 30 : PASSED=1 : Music Off : Sam Swapped : Screen Close 0 : Unpack 16 To 0 : Screen Hide 0 : End If
If PASSED=7 : PASSED=1 : End If
End Proc
Procedure BOOKL1
Shared BOOKT,BOOKREAD
BX=60 : BY=18 : Autoback 0 : Ink 8 : Bar 43,15 To 168,52
Paste Bob BX-10,25,11
For Z=1 To BOOKT
If Z<>BOOKREAD
Add BI,1,1 To 3 : Paste Bob BX,BY,BI : Paste Bob BX+1,BY+12,Z+63
End If
Add BX,12 : Next Z
Paste Bob BX,25,12
Screen Copy Logic(0) To Physic(0) : Autoback 2
End Proc
Procedure BOOKL2
Shared RD(),GS(),BOOKT,BOOKREAD,CRECT
RANDOM[BOOKT] : BX=60 : BY=18 : Autoback 0 : Ink 8 : Bar 43,15 To 168,52
Paste Bob BX-10,25,11
For Z=1 To BOOKT
If RD(GS(Z,1))<>BOOKREAD
Add BI,1,1 To 3 : Paste Bob BX,BY,BI : Paste Bob BX+1,BY+12,RD(GS(Z,1))+63
End If
Add BX,12 : Next Z
Paste Bob BX,25,12
Screen Copy Logic(0) To Physic(0) : Autoback 2
End Proc
Procedure BOOKL3
Shared USED(),RD(),GS(),X(),Y(),BOOKT,BOOKREAD
For Z=1 To 8 : USED(Z)=0 : Next Z : RANDOM[BOOKT]
BX=60 : BY=18 : Autoback 0 : Bob Update Off
For Z=30 To 19 Step -1
Bob Clear
Bob Off Z
Bob Draw
Next Z
Z=1
C=Rnd(6)+1
RDO:
C1=Rnd(6)+1 : I1=Rnd(6)+1 : I2=Rnd(6)+1
If C1=C : Goto RDO : End If
Bob 20,X(C),Y(C),I1+3 : Bob 21,X(C1),Y(C1),I2+3
Ink 8 : Bar 43,15 To 168,52
Paste Bob BX-10,25,11
Repeat
If Rnd(2)=1 and SPC<3 : Add BX,12 : Add SPC,1 : End If
If RD(GS(Z,1))<>BOOKREAD
Add BI,1,1 To 3 : Paste Bob BX,BY,BI : Paste Bob BX+1,BY+12,RD(GS(Z,1))+63
Add BX,12 : Add PT,1 : USED(PT)=RD(GS(Z,1))
End If
Add Z,1
Until PT=5
Paste Bob BX+36-(SPC*12),25,12
Screen Copy Logic(0) To Physic(0) : Bob Update On : Autoback 2
End Proc
Procedure BOOKL4
Shared SCB(),USED(),RD(),GS(),X(),Y(),BOOKT,BOOKREAD
RANDOM[7] : For Z=1 To 7 : USED(Z)=0 : SCB(Z)=RD(Z) : Next Z : USED(8)=0
RANDOM[BOOKT]
BX=60 : BY=18 : Autoback 0 : Bob Update Off
For Z=30 To 19 Step -1
Bob Clear
Bob Off Z
Bob Draw
Next Z
For Z=1 To 4 : I1=Rnd(6)+1 : Bob 19+Z,X(SCB(Z)),Y(SCB(Z)),I1+3 : Next Z
Z=1
Ink 8 : Bar 43,15 To 168,52
Paste Bob BX-10,25,11
Repeat
If Rnd(2)=1 and SPC<6 : Add BX,12 : Add SPC,1 : End If
If RD(GS(Z,1))<>BOOKREAD
Add BI,1,1 To 3 : Paste Bob BX,BY,BI : Paste Bob BX+1,BY+12,RD(GS(Z,1))+63
Add BX,12 : Add PT,1 : USED(PT)=RD(GS(Z,1))
End If
Add Z,1
Until PT=3
Paste Bob BX+60-(SPC*12),25,12
Screen Copy Logic(0) To Physic(0) : Bob Update On : Autoback 2
End Proc
Procedure NWLVL
'
Shared LEVEL
LEV=LEVEL
Fade 3 : Wait 45 : Bob Off : Wait Vbl : Cls 0 : Screen Swap : Cls 0
YY=80
SPOS=72
For L=0 To 3
If L<>3 : Paste Bob 89-24+L*47,44+YY,L+SPOS Else Paste Bob 89-24+L*47,44+YY,9+SPOS : End If
Update : Next L
Paste Bob 128,1+YY-60,SPOS+8
Bob 1,50-24+LEV*48,44+YY,4+SPOS
Limit Bob 0,0 To 319,44+YY : Wait 5
_FADE[1,1]
Update On : Move Y 1,"(1,-1,20)" : Move On 1 : Wait 20
Anim 1,"("+Str$(SPOS+3)+",8)("+Str$(SPOS+4)+",8)("+Str$(SPOS+5)+",8)("+Str$(SPOS+4)+",8)("+Str$(SPOS+3)+",8)("+Str$(SPOS+4)+",8)"
Anim On 1 : Wait 48
MFOL:
Inc LEV
If LEV=5 Then LEV=1 : Goto TTL1
Move X 1,"(1,1,48)" : Move Y 1,"(1,-1,6)(2,-1,2)(4,0,1)(2,1,2)(1,1,2)(2,1,2) (2,-1,2)(1,-1,2)(2,-1,2)(4,0,1)(2,1,2)(1,1,6)"
Anim 1,"("+Str$(SPOS+6)+",1)" : Anim On 1
Update Off : Anim On 1 : Move On 1
While Movon(1)>0
Wait Vbl : Update
Wend
Update On
Anim 1,"("+Str$(SPOS+6)+",55)("+Str$(SPOS+4)+",1)" : Anim On 1
Wait 60
GOEIO:
Timer=0 : Clear Key : I$=""
While I$<>" " and(I$<>Chr$(13))
I$=Inkey$ : SC=Scancode
If Jright(1) or(Mouse Key=2) or SC=78 or SC=89 Then I$=" "
If Timer>50*4 or Fire(1) or Mouse Key=1 Then I$=Chr$(13)
Wend
Extension_1_022E 1,3,0,0
If I$=" " Then Goto MFOL
Fade 1 : Wait 15 : Autoback 0
Goto NDSUB
TTL1:
Anim 1,"("+Str$(SPOS+7)+",1)"
Move X 1,"(1,-1,10)(1,-2,20)" : Move Y 1,"(1,1,20)" : Anim On : Move On
Wait 100 : Bob 1,50-24+LEV*48,44+YY,4+SPOS : Move Y 1,"(1,-1,20)" : Move On 1 : Wait 20
Anim 1,"("+Str$(SPOS+3)+",8)("+Str$(SPOS+4)+",8)("+Str$(SPOS+5)+",8)("+Str$(SPOS+4)+",8)("+Str$(SPOS+3)+",8)("+Str$(SPOS+4)+",8)"
Anim On 1 : Wait 48
Goto GOEIO
NDSUB:
LEVEL=LEV
Fade 1 : Wait 15 : Bob Off : Wait Vbl
Screen Close 0 : Unpack 16 To 0 : Screen Hide 0
Clear Key
End Proc
'
Procedure ANSTR
Shared S,SX(),SY()
STAR$="Anim 1,(18,2)(19,2)(20,2)(19,2)(18,2)" : S=Rnd(6)+1
If Chanan(S+8)=0
Bob S+8,SX(S),SY(S),18 : Amal S+8,STAR$ : Amal On S+8 : Wait Vbl
End If
Wait 5
End Proc
Procedure INIT
Load "teddybooks/chars2.abk" : Make Icon Mask : Extension_8_0016 0,0 : Bank Swap 2,10 : Bload "teddybooks/chars2.abk.cfnt", Extension_8_0044
End Proc
Procedure GTDTA
Shared SX(),SY(),TX(),TY(),X(),Y()
For Z=1 To 7 : Read X(Z),Y(Z) : Next Z
For Z=1 To 6 : Read TX(Z),TY(Z) : Next Z
For Z=1 To 7 : Read SX(Z),SY(Z) : Next Z
Data 14,162,80,160,136,162,198,159,32,112,96,114,184,113
Data 46,73,80,73,110,73,145,72,175,74,209,73
Data 207,16,211,30,219,24,236,18,249,19,242,25,237,38
End Proc
Procedure RANDOM[AMNT]
Shared RD()
Timer=0 : Wait Rnd(5)+1 : Randomize Timer
For Z=1 To AMNT : RD(Z)=Z : Next Z
Repeat
Repeat : SWP=Rnd(AMNT) : Until SWP>0
Swap RD(SWP),RD(AMNT) : Add CTR,1
Until CTR=AMNT
End Proc
PRNTIT:
Autoback 0
Cls 13,0,189 To 320,199 : Extension_8_0006 3,198,P$
Screen Copy Logic(0),0,189,320,199 To Physic(0),0,189
PL= Extension_8_0028(P$)
Autoback 2
Return
Procedure _FADE[X,S]
If X=1 Then Fade S,$0,$EEE,$8AA,$246,$484,$80,$44E,$22E,$E66,$E44,$EE0,$A42,$620,$E84,$0,$E0E : Wait S*15 Else Fade S : Wait S*15
End Proc